﻿#define _CRT_SECURE_NO_WARNINGS
#include"bitset.h"
#include<bitset>
using namespace bis;
void test_bs1() {
	
	int a1[] = { 5,7,9,2,5,99,5,5,7,5,3,9,2,55,1,5,6 };//出现多个返回-1
	//std::bitset<100> bs1;
	bis::bitset<100> bs1;
	bs1.set(32);
	bs1.set(33);
	cout<<bs1.test(32)<<endl;

	for (auto e : a1)
	{
		bs1.set(e);
	}
	cout << bs1.test(99) << endl;
	cout << bs1.test(10) << endl;

	

	
}
void test_tbs2() {
	twobitset<100>tbs;
	int a[] = { 5,7,9,2,5,99,5,5,7,5,3,9,2,55,1,5,6,6,6,6,7,9 };//出现多个返回-1

	for (auto e : a)
	{
		tbs.set(e);
	}
	cout << "6" << "->" << tbs.get_count(6) << endl;
	cout << "55" << "->" << tbs.get_count(55) << endl;
	cout << "0" << "->" << tbs.get_count(0) << endl;
	cout << "2" << "->" << tbs.get_count(2) << endl;


	/*for (size_t i = 0; i < 100; ++i)
	{
		cout << i << "->" << tbs.get_count(i) << endl;

	}*/
}

int main() {
	//test_bs1();
	test_tbs2();
	//bis::bitset<UINT_MAX> bs;
	return 0;
}

 //封装bitset的应用拓展：
 // 
//给定100亿个整数，设计算法找到只出现⼀次的整数？

//给两个文件，分别有100亿个整数，我们只有1G内存，如何找到两个文件交集 ?

//一个文件有100亿个整数，1G内存，设计算法找到出现次数不超过且不等于n次的所有整数
